const visitService = require('@/services/visit.service')
const JsonResult = require('@/utils/httpResponse.util')

class VisitController {
  async findPage (req, response) {
    const { pageNo, pageSize, ...attrs } = req.query
    try {
      const data = await visitService.findPageList(pageNo, pageSize, attrs)
      JsonResult.success({
        req,
        response,
        data,
        message: '查询成功'
      })
    } catch (error) {
      JsonResult.fail({ req, response, error, message: '查询失败' })
    }
  }
}

module.exports = new VisitController()
